<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core">
    
    <body>
        <p:panel header="Tüm Gruplar">
                <h:form>
            <p:accordionPanel  var="communitym" value="#{CommunityBean.giveAll()}">
                <p:tab title="#{communitym.name}"> 
                    <c:if test="#{communitym.userType()==true}">
                        <p:commandLink value="#{communitym.admin.fullName}" action="#{HomePageBean.clickTeacher()}" ajax="false">
                            <f:setPropertyActionListener value="#{HomePageBean.user}" target="#{TeacherBean.target}"/>
			</p:commandLink>	
                 </c:if>
                 <c:if test="#{communitym.userType()==false}">
                     <p:commandLink value="#{communitym.admin.fullName}" action="#{HomePageBean.clickStudent()}" ajax="false">
                            <f:setPropertyActionListener value="#{HomePageBean.user}" target="#{StudentBean.target}"/>
			</p:commandLink>	
                 </c:if>
                    <h:outputLabel value=" tarafından oluşturuldu."/>
                    <p:commandButton value="Üye Ol" rendered="#{CommunityBean.memberOf(communitym)==false}"  action="#{CommunityBean.joinCommunity()}"  ajax="false" style="margin-left:123px ">
                                <f:setPropertyActionListener value="#{communitym}" target="#{CommunityBean.target}"/>
                    </p:commandButton>
                    <h:outputLabel value="Zaten üyesiniz." rendered="#{CommunityBean.memberOf(communitym)==true}"/>
                </p:tab>
             </p:accordionPanel>
            
                </h:form>
        </p:panel>
    </body>
</html>
